<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'list';
$return=array();
if($_RQ['op']=='list'){
	//日志列表
	$pindex = max(1, intval($_RQ['page']));
	$psize = 10;
	$params = array('type'=>3);
	if(!empty($_RQ['name'])){
		$params['name like']='%'.trim($_RQ['name']).'%';
		$return['params']['name']=$_RQ['name'];
	}
	$pindex = max(1, intval($_RQ['page']));
	$psize = 20;
	$fields=array('id','name','createtime');
	$list=pdo_getslice('core_users',$params,array($pindex,$psize),$total,$fields,'','id desc');
	if($list){
		foreach($list as &$item){
			//$item['agentname']=pdo_getcolumn('core_users',array('id'=>$item['agentid']),'name');
			//$item['log']='由“' . $item['agentname'] . '”推荐加入！';
		}
	}
	$return['list']=$list;
	$totalpage=ceil($total/$psize);
	$totalpage=intval($totalpage);
	$return['totalpage'] =$totalpage;
	$return['params']['page'] =$pindex;
	//页面显示设置
	$htmls=array(
		'type'=>'list',
		'tabs'=>array(
			array('op'=>'list','title'=>'日志列表'),
		),
		'list'=>array('data'=>'list','delall'=>false,'del_one'=>false,'edit'=>false,'list'=>array(
			array('name'=>'id','title'=>'新会员ID','type'=>'string'),
			array('name'=>'name','title'=>'新会员','type'=>'string'),
			//array('name'=>'agentname','title'=>'推荐人','type'=>'string'),
			array('name'=>'agentid','title'=>'推荐人id','type'=>'string'),
			//array('name'=>'log','title'=>'加入日志','type'=>'string'),
			array('name'=>'createtime','title'=>'加入时间','type'=>'time'),
		)),
		'search_one'=>array('add'=>false,'name'=>'name'),
	);
	$return['htmls']=$htmls;
	exi($return);
}
?>